package featuremodel.predication;

import featuremodel.FeatureRep;
import skyblue.Method;
import skyblue.SkyBlueDef;
import skyblue.Variable;

public class CompositeSingleFalseTwo extends Method {
	private Variable feature1;
	private Variable feature2;

	public CompositeSingleFalseTwo(Variable feature1, Variable feature2) {
		this.feature1 = feature1;
		this.feature2 = feature2;
		getOutputs().add(feature1);
		getOutputs().add(feature2);

	}

	public void setTobeMethodType() {

		feature1.setTobemethodtype(SkyBlueDef.METHOD_TYPE_UNBIND);
		feature2.setTobemethodtype(SkyBlueDef.METHOD_TYPE_UNBIND);

	}
	public void clearTobeMethodType() {
		feature1.setTobemethodtype(null);
		feature2.setTobemethodtype(null);

	}

	public void setTobeMethodType2() {
		feature1.setTobeMethodType2(SkyBlueDef.METHOD_TYPE_UNBIND);
		feature2.setTobeMethodType2(SkyBlueDef.METHOD_TYPE_UNBIND);

	}

	public void clearTobeMethodType2() {
		feature1.setTobeMethodType2(null);
		feature2.setTobeMethodType2(null);
	}

	public void execute() {
		FeatureRep fp = (FeatureRep) feature1.getValue().getValuerep();
		fp.setBindState(SkyBlueDef.VARIABLE_UNBIND);
		feature1.setMethodtype(SkyBlueDef.METHOD_TYPE_UNBIND);
		feature1.setTobemethodtype(null);

		fp = (FeatureRep) feature2.getValue().getValuerep();
		fp.setBindState(SkyBlueDef.VARIABLE_UNBIND);
		feature2.setMethodtype(SkyBlueDef.METHOD_TYPE_UNBIND);
		feature2.setTobemethodtype(null);

	}

}
